<?php
/**
 * Created by PhpStorm.
 * User: wodrow
 * Date: 18-4-8
 * Time: 上午9:12
 */

namespace common\models;


class AndroidAppVersions extends \common\models\base\AndroidAppVersions
{
    const STATUS_ACTIVE = 10;
    const STATUS_UNUSE = 9;
    const STATUS_OTHER_USE = 11;
    public static function getStatus()
    {
        return [
            self::STATUS_UNUSE => '不用',
            self::STATUS_ACTIVE => '使用中',
            self::STATUS_OTHER_USE => '其他使用',
        ];
    }

    const FACE_MODE_OTHER = 'OTHER';
    const FACE_MODE_ALC = 'ALI';
    const FACE_MODE_CHINAPAY = 'CHINAPAY';
    public static function getFaceMode()
    {
        return [
            self::FACE_MODE_ALC => self::FACE_MODE_ALC,
            self::FACE_MODE_CHINAPAY => self::FACE_MODE_CHINAPAY,
            self::FACE_MODE_OTHER => self::FACE_MODE_OTHER,
        ];
    }

    /**
     * @return null|static
     */
    public static function getInUse()
    {
        return static::find()->where(['status' => self::STATUS_ACTIVE])->orderBy(['id' => SORT_DESC])->one();
    }

    /**
     * @return null|static
     */
    public static function getOtherUse()
    {
        return static::find()->where(['status' => self::STATUS_OTHER_USE])->orderBy(['id' => SORT_DESC])->one();
    }
}